import React from 'react'
import { Toast, Card, Empty } from 'antd-mobile'
import { $pre } from '../../../http/http';
import "./ShopList.less"

export default function ShopList(props) {
  let { shoplist } = props;
  console.log('shoplist', shoplist);
  const onClick = () => {
    Toast.show('点击了卡片')
  }
  return (
    <div className='shop_list'>
      {shoplist.length == 0 ? <Empty description='暂无数据' /> :
        <div>
          {
            shoplist.map((item) => {
              return <Card onClick={onClick} key={item.id}>
                <h1>商品分类名称:{item.goodsname}</h1>
                <img src={$pre + item.img} alt="" />
                <div>原价：{item.market_price}</div>
                <div>现价：{item.price}</div>
              </Card>
            })
          }
        </div>

      }

    </div>
  )
}
